#ifndef WINDOWS_CGL_H_INCLUDED
#define WINDOWS_CGL_H_INCLUDED

// implementation of cglib on windows os
#include "windows.h"

#include "colored_stream.h"

// "private" function to make change color functions work
HANDLE get_handle() {
    HANDLE handle;
    handle = GetStdHandle( STD_OUTPUT_HANDLE );
    return handle;
}

// changes color of text in console
// second parameter is background color
// both from 0 to 15
void text_color( int color = 7, int back_color = 0 ) {
    HANDLE handle = get_handle();
    SetConsoleTextAttribute( handle, color + back_color * 16 );
}
// this uses my own color enum
void text_color( color cl = GREY, color back_cl = BLACK ) {
    text_color( int( cl ), int( back_cl ) );
}
// resets console text color
void reset_color() {
    text_color( 7, 0 );
}

#endif // WINDOWS_CGL_H_INCLUDED
